package com.doit.day02;

import org.apache.hadoop.hbase.NamespaceDescriptor;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.Connection;

import java.io.IOException;
import java.util.Map;

public class _04_列出所有的名称空间 {
    public static void main(String[] args) throws IOException {
        Connection conn = HbaseUtil.getConn();
        Admin admin = conn.getAdmin();

        //列出
        NamespaceDescriptor[] namespaceDescriptors = admin.listNamespaceDescriptors();

        //遍历数据
        for (NamespaceDescriptor namespaceDescriptor : namespaceDescriptors) {
            String name = namespaceDescriptor.getName();
            Map<String, String> map = namespaceDescriptor.getConfiguration();
            System.out.println("名称空间的名称是:"+name);
            System.out.println("配置信息是:"+map);
            System.out.println("==============帅气的分隔符==================");

        }

    }
}
